package com.project.web.course.controller.app;

import com.project.common.core.utils.exception.CustomException;
import com.project.common.core.utils.exception.RESP_CODE_ENUM;
import com.project.common.core.utils.exception.Result;
import com.project.common.core.utils.file.FilePathConsts;
import com.project.common.core.utils.file.FileUtil;
import com.project.web.course.controller.common.BaseController;
import com.project.web.course.model.app.CourseCategory;
import com.project.web.course.service.app.CourseCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 课程类目控制器
 *
 * @Author: wyy
 * @Date: 2020-04-15 16:56
 */
@Api(tags = "课程类目API")
@RestController("courseServiceCourseCategoryController")
@RequestMapping("/course/auth/category")
public class CourseCategoryController extends BaseController {

    /**
     * 日志工具类
     */
    public static final Logger log = LoggerFactory.getLogger(CourseCategoryController.class);

    @Resource(name = "courseCategoryServiceImpl")
    private CourseCategoryService courseCategoryService;

    /**
     * 查询所有节点
     *
     * @return
     */
    @ApiOperation(value = "查询所有节点")
    @GetMapping(value = "/getAll")
    public Result<List<CourseCategory>> getAll() {
        List<CourseCategory> categories = courseCategoryService.getAll();
        return getResult(categories);
    }

}
